<template>
	<view>
		艺人
		<button @click="pre">支付</button>
		<button @click="login">登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		methods:{
			// 仅作为示例，非真实参数信息。
			pre(){
				uni.getProvider({
					service:'payment',
					success:function(res){
						console.log(res);
						console.log(res.provider)
						
					}
				})
				uni.requestPayment({
				    provider: 'wxpay',
					timeStamp: String(Date.now()),
					nonceStr: '5K8264ILTKCH16CQ2502SI8ZNMTM67VS',
					package: 'prepay_id=wx2017033010242291fcfe0db70013231072',
					signType: 'MD5',
					paySign: '22D9B4E54AB1950F51E0649E8810ACD6',
					success: function (res) {
						console.log('success:' + JSON.stringify(res));
					},
					fail: function (err) {
						console.log('fail:' + JSON.stringify(err));
					}
				});
			},
			login(){
				uni.getProvider({
					service: 'oauth',
					success: function (res) {
						console.log(res.provider)
						if (~res.provider.indexOf('qq')) {
							uni.login({
								provider: 'qq',
								success: function (loginRes) {
									console.log(JSON.stringify(loginRes));
								}
							});
						}
					}
				});
			}
		}
	}
	

</script>

<style lang="scss">

</style>
